package com.central.common.feign

import com.central.common.constant.ServiceNameConstants
import com.central.common.enum.AttentionTypeEnum
import com.central.common.feign.fallback.AttentionServiceFallbackFactory
import com.central.common.model.RealDataResult
import org.springframework.cloud.openfeign.FeignClient
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestParam

/**
 * @author  fly
 * @date  2021/5/27 17:26
 * @version 1.0
 */
@FeignClient(name = ServiceNameConstants.REAL_SERVICE, fallbackFactory = AttentionServiceFallbackFactory::class, decode404 = true)
interface AttentionService {


    /**
     * 获取我关注的列表
     */
    @GetMapping("/attention/getMyAttentionUserId")
    fun getMyAttentionIdList(
        @RequestParam("userId") userId: Long,
        @RequestParam("attentionTypeEnum") attentionTypeEnum: AttentionTypeEnum
    ): List<String>?


    /**
     * 是否关注
     */
    @PostMapping("/attention/booleanAttention")
    fun booleanAttention(
        @RequestParam("attentionId") attentionId: Long,
        @RequestParam("userId") userId: Long,
        @RequestParam("attentionTypeEnum") attentionTypeEnum: AttentionTypeEnum
    ): RealDataResult?


    /**
     * 获取我的粉丝用户列表
     */
    @GetMapping("/attention/getMyFansUserId/{userId}")
    fun getMyFansUserId(@PathVariable("userId") userId: Long): List<String>?
}